<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>商品信息</title>

<link rel="stylesheet" href="//apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="CSS/CSSproductshow.css" />




  <script src="//apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
  <script src="js/jsproshow.js"></script>



</head>

<body>

<?php
include "head.php";

?>
   
<div id="tbody" style="width: 1100px; height: auto; margin: 0 auto; border: 0px solid #000">
    <div id="menu2"> 
            <ul>
                
          <?php
		        //循环输出menu1，并赋id给其超链接
		    $query1 = "select * from product_class order by show_order";
			$result1 = $aa->excu($query1);
			while ($product_class = mysqli_fetch_array($result1, MYSQLI_ASSOC))	{	

		?>
                
                
                <li><a href="shoppingmall.php?action=creat&id=<?php echo $product_class['id']; ?>">
				<?php echo $product_class['class_name']; ?></a>

                </li>
          <?php
			      }
	   	?>
            </ul>
        </div> 
        
        
        <!--product_info-->  
      
          <!--商品购买信息-->
          <div id="ps">
              <div class="left" id="ps01">
                  <div id="ps0101">
                  
                       <?php  
					          $productid= @$_GET["id"];
							  // var_dump ($productid); 
							  $query = "select * from product_info where id = $productid ";
			                  $result = $aa->excu($query);
                              $product = mysqli_fetch_array($result, MYSQLI_ASSOC);
							 // var_dump($product);
                              $img = $product['imgsrc'];  
							  $img = explode("#", $img);  
							 // var_dump($img);
							  $num = count($img); 
				            for($i = 0; $i < $num; $i++){  
							    if($i == 0){
							?>
                              <img src="<?php echo $img[$i]; ?>" class="#ps01 img imgsel" />
                            <?php }
							      else{ ?>
                              <img src="<?php echo $img[$i]; ?>" class="#ps01 img" />
                        <?php } }?>

                  </div>
              </div>
              
              <div class="left" id="ps02">
                  <div>
                    <img src="<?php echo $img[0]; ?>" alt="哈哈，没有图片！" />
                  </div>
              </div>
              
              <div class="left" id="ps03">
                  <div>

                     <table>
                         <tr><td width="450px" id="nameshow01"><h2 id="proname"><?php echo $product['name']; ?></h2></td></tr>
                         <tr><td width="400px"><small><?php echo $product['intro']; ?></small></td><td width="50px"><b>￥<?php echo $product['price']; ?></b></td></tr>
                         <tr>
                             <?php 
							     if($product['ex01'] != '' ){
								   $ex01 = explode("#", $product['ex01']); 
							       $ex012 = explode("^", $ex01[1]);
								   $num = count($ex012); 
								   //var_dump($ex01); 
								   //var_dump($ex012);
							 ?>
                             <td><?php echo $ex01[0]; ?></td>
                             <td><p id="ex01"> 
                              <?php for($i = 0; $i < $num; $i++){ ?>
                               <span style=" background-image: url(<?php echo $ex012[$i]; ?>);" ></span>
                               <?php } ?>
                               </p></td>
                               <?php } ?>
                          </tr>
                          <tr>
                              <?php 
							   if($product['ex02'] != '') { 
								   $ex02 = explode("#", $product['ex02']); 
							       $ex022 = explode("^", $ex02[1]);
								   $num = count($ex022); 
								   //var_dump($ex022);
							 ?>
                              <td><?php echo $ex02[0]; ?></td>
                              <td class="heikuang" id="ex02"> 
                                 <p id="ex02p">
                                  <?php for($i = 0; $i < $num; $i++){ ?>
                                   　<span id="jk<?php echo $i; ?>"><?php echo $ex022[$i]; ?></span>
                                  <?php } } ?>
                                 </p>
                             </td>
                         </tr>
                         <tr><td>
                             <p id="ddj">数量</p></td><td class="left20"><img src="img/ddjian.png" id="jian" /></td><td  class="left20"><input type="text" id="shuliang" value="1"></td><td  class="left20"><img src="img/ddjia.png" id="jia" />
                             </td>
                         </tr>
                         <tr id="gm">
                             <td >
                               <p id="gocar">加入购物车</p><img src="img/head-logo.jpg" style=" display: none;" />
                             </td>
                             <td>
                                <p id="gobuy">现在购买</p>
                             </td>
                         </tr>
            
                     </table>
                     
                  
                       
                 </div>
              </div>
          
          </div>
          
          
      <div id="tabs">
          <ul>
              <li><a href="#tabs-1">商品信息</a></li>
              <li><a href="#tabs-2">技术规格</a></li>
              <li><a href="#tabs-3">用户评价&nbsp;                  
                      <?php $query = "select * from pro_evaluate where pro_id = $productid ";
			                  $result_eval = $aa->excu($query);
							  //var_dump($result_eval);
							?> 
						<span><small>	<?php echo $num_eval = $result_eval->num_rows;
							  //var_dump($num_eval);
							?></small></span>
                  </a>
              </li>
          </ul>
          <!--产品详细信息-->
          <div id="tabs-1">
              
          <?php  
				
                              $det_info = $product['det_info'];  
							  $det_info = explode("#", $det_info);
							  //var_dump($det_info);  
							  $num = count($det_info); 
				            for($i = 0; $i < $num; $i++){  ?>
                              <img src="<?php echo $det_info[$i];  ?>" class="detinfo" />
                        <?php } ?>
              
          </div>
          <!--技术规格-->
          <div id="tabs-2">
              <h2>技术规格</h2>
              <table id="tabletech">
                            <?php  
                              $tech = $product['tech'];  
							  $tech = explode("#", $tech);
							  //var_dump($det_info);  
							  $num = count($tech); 
				            for($i = 0; $i < $num; $i++){ 
							    $tech2 = explode("^",$tech[$i]); 
			                 ?>     
                 
                      
                         <tr><th><?php echo $tech2[0];  ?> </th><td><?php echo $tech2[1];  ?> </td></tr>
                     

              <?php } ?>
                
          </table>
          
          </div>
          <!--用户评价-->
          <div id="tabs-3" style=" overflow: hidden;">
             
							  
             <table class="st">                  
				       <?php     while($row = mysqli_fetch_row($result_eval)){  ?>
                  <tr>          
                      <td style=" width: 650px;">
                          <ul>
                              <li><small><?php if($row['2']){ echo $row['2']; } ?></small></li>
                              <li>
                                  <?php 
									  if($row['3']){
										$st = explode("#", $row['3']);
										$num = count($st);
										for($i = 0; $i < $num; $i++){  
										      ?>
                                    <img src="<?php echo $st[$i]; ?>" />
                                    <?php }  }?>
                              </li>
                              <li><small><?php if($row['4']){ echo $row['4']; } ?></small></li>
                              <li>
                                  <?php 
									  if($row['5']){
										$st = explode("#", $row['5']);
										$num = count($st);
										for($i = 0; $i < $num; $i++){  
										      ?>
                                    <img src="<?php echo $st[$i]; ?>" />
                                    <?php } }?>
                              </li>
                          </ul>
                      </td>
                      <td style=" width: 250px;" class="borderlr">
                          <ul id="p_info">
                                    <?php 
									    $p_info = explode("#", $row['7']);
										$num = count($p_info);
										for($i = 0; $i < $num; $i++){  
										   ?>
                                            
											<li><?php echo $p_info[$i]; ?></li>	
										<?php } ?>
							
                           </ul>
                      </td>
                      <td style=" width: 150px; padding-left: 15px;"><?php echo $row['6']; ?></td>          
                            
                  </tr>
                <?php } ?>
             </table>
                            

          </div>

      </div>

</div>
<?php
include "foot.php";
?>
</body>
</html>